#include <QtGui/QApplication>
#include <QDeclarativeContext>
#include "qmlapplicationviewer.h"
#include <QString>

#define DO_QUOTE(X)       #X
#define QUOTE(X)          DO_QUOTE(X)


Q_DECL_EXPORT int main(int argc, char *argv[])
{
    QScopedPointer<QApplication> app(createApplication(argc, argv));
    QScopedPointer<QmlApplicationViewer> viewer(QmlApplicationViewer::create());

    // Trochę czarow, pobranie klucza(API_KEY) do demotywatory.pl
    // i udostepnienie go w aplikacji.
    QString apikey(QUOTE(DEMOTKEY));
    QDeclarativeContext *ctx = viewer->rootContext();
    ctx->setContextProperty("api",apikey);

    viewer->setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait);
    viewer->setMainQmlFile(QLatin1String("qml/SzybkiDemot/main.qml"));
    //viewer->setMainQmlFile(QLatin1String("/opt/SzybkiDemot/qml/SzybkiDemot/main.qml"));
    viewer->showExpanded();

    return app->exec();
}
